import request from "../../utils/request";
// 获取attrList
export const reqSpuInfoList = ({ page, limit, category3Id }) => {
  return request({
    method: "GET",
    url: `/admin/product/${page}/${limit}`,
    params: {
      category3Id
    }
  });
};

// 获取所有的销售属性列表
export const reqBaseSaleAttrList = () => {
  return request({
    method: "GET",
    url: `/admin/product/baseSaleAttrList`
  });
};

// 添加spu
export const reqSaveSpuInfo = data => {
  return request({
    method: "POST",
    url: `/admin/product/saveSpuInfo`,
    data
  });
};

// 通过spuId等到整个这个商品的信息
export const reqGetSpuById = spuId => {
  return request({
    method: "GET",
    url: `/admin/product/getSpuById/${spuId}`
  });
};

// 删除SPU
export const reqDeleteSpu = spuId => {
  return request({
    method: "DELETE",
    url: `/admin/product/deleteSpu/${spuId}`
  });
};

//修改Spu
export const reqUpdateSpuInfo = data => {
  return request({
    method: "POST",
    url: `/admin/product/updateSpuInfo`,
    data,
  });
};
